package by.bsuir.chess.validators
{
	import by.bsuir.chess.models.GameModel;
	import by.bsuir.chess.vo.Piece;

	import flash.geom.Point;

	public class BeatValidator
	{
		//return true if piece beats another pieace on position p. Does not check if
		//piece can move to p!!!
		public static function validate(piece : Piece, p : Point) : Boolean
		{
			var testPiece : Piece = GameModel.inst.boardState[p.x][p.y];
			return testPiece && testPiece.color != piece.color;
		}
	}
}
